package com.goods.utils;

import com.goods.enumeration.CodeEnumeration;

public class ResultUtils {



    public  static  Result ok(){
        Result result=new Result();
        result.setCode(CodeEnumeration.SUCCESS.getCode());
        result.setData("");
        result.setMessage(CodeEnumeration.SUCCESS.getMessage());
        return result;
    }


    public  static  Result error(Integer code ,String message){
        Result result=new Result();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }


    public  static  Result ok(Object data){
        Result result=new Result();
        result.setCode(CodeEnumeration.SUCCESS.getCode());
        result.setData(data);
        return result;
    }
}
